<template>
     <div>点击按钮会调用后端查询所有课程方法<br>
      <Button type="primary" @click="getAllSubject">Primary99</Button>
      <div>
        {{subject}}
      </div>
     </div>
    
</template>
<script>
import axios from '@/libs/api.request.js'
export default {
  data() {
    return {
      subject:[]
    }
  },

  methods: {
    //获取课程列表
    getAllSubject(){
      axios.request({
        url:'/subject/queryAll',
        method: "get"
      }).then((res)=>{
        this.subject=res.data.message
      })
    }
  }
}
</script>